<template>
  <div class="about">
    <h1>This is an about page</h1>
  </div>
</template>
<script setup lang="ts">
let age: number = 18
console.log(age);

let name: string = '123'
console.log(name);

let obj: object = {
  name: '张三',
  age: 18,
  like: '过家家',
  eat: () => {
    console.log(123);
  }
}
console.log(obj);

let bool: boolean = false
console.log(bool);

let nu: null = null
console.log(nu);

let un: undefined = undefined
console.log(un);

let sy: symbol = Symbol(1)
console.log(sy);

let arr: number[] = [1, 2, 3]
console.log(arr);

let arr1: string[] = ['1', '2', '3']
console.log(arr1);

let arr2: [number, string] = [1, '2']
console.log(arr2);

enum aa { 'a', 'b', 'c' }
let aaa = aa.b   // 获取下标
console.log(aaa);

enum bb { a = 1, b = 2, c = 3 }
let bbb = bb.b
console.log(bbb);

let cc: any = 1
console.log(cc);

let dd: any = 'a'
console.log(dd);

function fn(): void {
  // return "123"
  console.log(aaa);
}
console.log(fn);

let ac: any = 'I Love You'
// let bc = (ac as string).length
let bc = (<string>ac).length
console.log(bc);
</script>
